package com.bops.dal.product.dao.impl;

import java.util.HashMap;
import java.util.List;

import com.bops.dal.product.dao.Type3DAO;
import com.bops.dal.product.dataobject.TypeThree;
import com.bops.dal.product.queryobject.TypeThreeQuery;
import com.yue.commons.db.ibatis.YueBaseSqlMapClientDaoSupport;

public class Type3DAOImpl  extends YueBaseSqlMapClientDaoSupport implements Type3DAO {
	private static final String NAME_SPACE = "TYPE3_PRODUCT.";
	
	
	public int countType3(HashMap<String, Object> map) {
		return (Integer) getSqlMapClientTemplate().queryForObject(NAME_SPACE + "count_Type3", map);
	}
	public int checkType3Name(TypeThree editType3 ) {
		return (Integer) getSqlMapClientTemplate().queryForObject(NAME_SPACE + "checkName",  editType3);
	}

	public int deleteType3ById(Integer id) {
		int rows = getSqlMapClientTemplate().delete(NAME_SPACE + "delete", id);
		return rows;
	}

	
	public void insertType3(TypeThree record) {
		getSqlMapClientTemplate().update(NAME_SPACE + "insert", record);
	}

	
	public int updateType3(TypeThree record) {
		int rows = getSqlMapClientTemplate().update(NAME_SPACE + "update", record);
		return rows;
	}

	@SuppressWarnings("unchecked")
	public List<TypeThree> listType3(TypeThreeQuery query) {
		if (query==null)
        {
            query = new TypeThreeQuery();
            query.setPageSize(Integer.MAX_VALUE);
        }
        return getSqlMapClientTemplate().queryForPagination(NAME_SPACE + "count_Type3",
        		NAME_SPACE + "list_Type3", query);
	}
	
	@SuppressWarnings("unchecked")
	public List<TypeThree> completeType3(TypeThreeQuery query) {
		return getSqlMapClientTemplate().queryForList(NAME_SPACE + "complete_Type3", query);
	}

	
	public TypeThree findType3ById(Integer id) {
		return (TypeThree)getSqlMapClientTemplate().queryForObject(NAME_SPACE + "listById", id);
	}
	public TypeThree findType3IDByName( TypeThreeQuery queryType3) {
		return (TypeThree)getSqlMapClientTemplate().queryForObject(NAME_SPACE + "type3IdByName", queryType3);
	}
    
}